//
//  NewPasswordVC.m
//  WanCaiC8
//
//  Created by tangang on 2018/3/29.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "NewPasswordVC.h"
#import "LoginVM.h"
@interface NewPasswordVC ()
@property (weak, nonatomic) IBOutlet UITextField *passwordText;
@property (weak, nonatomic) IBOutlet UIButton *btnDone;

@end

@implementation NewPasswordVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"找回密码";
    // Do any additional setup after loading the view.
}

- (IBAction)done:(UIButton *)sender {
    if (_passwordText.text.length<6||_passwordText.text.length>16) {
        [SVProgressHUD showErrorWithStatus:@"密码位数不对"];
        return;
    }
    [self.userInfo setObject:_passwordText.text forKey:@"Password"];
    [[LoginVM manage] forgetPassword:self.userInfo andSuccess:^(id returnValue) {
        
        [[BaseVM manage] login];
    } andFail:^(NSString *errorMessage, NSError *error) {
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
